using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar;
using Public;
using BLL;

namespace QLNhanKhau
{
    public partial class frmDangNhap : DevComponents.DotNetBar.Metro.MetroForm
    {
        public frmDangNhap()
        {
            InitializeComponent();
        }
        frmMain fm = new frmMain();
        private void btnDangNhap_Click(object sender, EventArgs e)
        {
            NguoiDungPublic nd = new NguoiDungPublic();
            nd.TenDangNhap = txtTenDangNhap.Text;
            nd.MatKhau = txtMatKhau.Text;
            if (NguoiDungBLL.KiemTraDangNhap(nd.TenDangNhap, nd.MatKhau) == true)
            {
                fm.Show();
                this.Hide() ;
            }
            else
            {
                labLoiDangNhap.Text = "Sai tên đăng nhập hay mật khẩu";
                txtTenDangNhap.Text = "";
                txtMatKhau.Text = "";
            }
        }

        private void btnThoat_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void txtTenDangNhap_TextChanged(object sender, EventArgs e)
        {

        }
    }
}